home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / ShowSystemColors.java < prev    next >
Text File  |  1998-09-08  |  10KB  |  175 lines

  1. package com.symantec.itools.tools.utilities;
  2.  
  3.  
  4. import java.awt.SystemColor;
  5. import java.awt.Color;
  6. import com.symantec.itools.frameworks.application.commandline.Application;
  7.  
  8.  
  9. /**
  10.  * @author Symantec Internet Tools Division
  11.  * @version 1.0
  12.  * @since VCafe 3.0
  13.  */
  14.  
  15. public class ShowSystemColors
  16.     extends Application
  17. {
  18.  
  19.     /**
  20.      * @param argv TODO
  21.      * @since VCafe 3.0
  22.      */
  23.     public static void main(String[] argv)
  24.     {
  25.         System.out.println("activeCaption         " + colorToString(SystemColor.activeCaption.getRed(),
  26.                                                                     SystemColor.activeCaption.getGreen(),
  27.                                                                     SystemColor.activeCaption.getBlue()));
  28.         System.out.println("activeCaptionBorder   " + colorToString(SystemColor.activeCaptionBorder.getRed(),
  29.                                                                     SystemColor.activeCaptionBorder.getGreen(),
  30.                                                                     SystemColor.activeCaptionBorder.getBlue()));
  31.         System.out.println("activeCaptionText     " + colorToString(SystemColor.activeCaptionText.getRed(),
  32.                                                                     SystemColor.activeCaptionText.getGreen(),
  33.                                                                     SystemColor.activeCaptionText.getBlue()));
  34.         System.out.println("control               " + colorToString(SystemColor.control.getRed()  , 
  35.                                                                     SystemColor.control.getGreen(),
  36.                                                                     SystemColor.control.getBlue()));
  37.         System.out.println("controlDkShadow       " + colorToString(SystemColor.controlDkShadow.getRed(),
  38.                                                                     SystemColor.controlDkShadow.getGreen(),
  39.                                                                     SystemColor.controlDkShadow.getBlue()));
  40.         System.out.println("controlHighlight      " + colorToString(SystemColor.controlHighlight.getRed(),
  41.                                                                     SystemColor.controlHighlight.getGreen(),
  42.                                                                     SystemColor.controlHighlight.getBlue()));
  43.         System.out.println("controlLtHighlight    " + colorToString(SystemColor.controlLtHighlight.getRed(),
  44.                                                                     SystemColor.controlLtHighlight.getGreen(),
  45.                                                                     SystemColor.controlLtHighlight.getBlue()));
  46.         System.out.println("controlShadow         " + colorToString(SystemColor.controlShadow.getRed(),
  47.                                                                     SystemColor.controlShadow.getGreen(),
  48.                                                                     SystemColor.controlShadow.getBlue()));
  49.         System.out.println("controlText           " + colorToString(SystemColor.controlText.getRed(),
  50.                                                                     SystemColor.controlText.getGreen(),
  51.                                                                     SystemColor.controlText.getBlue()));
  52.         System.out.println("desktop               " + colorToString(SystemColor.desktop.getRed(),
  53.                                                                     SystemColor.desktop.getGreen(),
  54.                                                                     SystemColor.desktop.getBlue()));
  55.         System.out.println("inactiveCaption       " + colorToString(SystemColor.inactiveCaption.getRed(),
  56.                                                                     SystemColor.inactiveCaption.getGreen(),
  57.                                                                     SystemColor.inactiveCaption.getBlue()));
  58.         System.out.println("inactiveCaptionBorder " + colorToString(SystemColor.inactiveCaptionBorder.getRed(),
  59.                                                                     SystemColor.inactiveCaptionBorder.getGreen(),
  60.                                                                     SystemColor.inactiveCaptionBorder.getBlue()));
  61.         System.out.println("inactiveCaptionText   " + colorToString(SystemColor.inactiveCaptionText.getRed(),
  62.                                                                     SystemColor.inactiveCaptionText.getGreen(),
  63.                                                                     SystemColor.inactiveCaptionText.getBlue()));
  64.         System.out.println("info                  " + colorToString(SystemColor.info.getRed(),
  65.                                                                     SystemColor.info.getGreen(),
  66.                                                                     SystemColor.info.getBlue()));
  67.         System.out.println("infoText              " + colorToString(SystemColor.infoText.getRed(),
  68.                                                                     SystemColor.infoText.getGreen(),
  69.                                                                     SystemColor.infoText.getBlue()));
  70.         System.out.println("menu                  " + colorToString(SystemColor.menu.getRed(),
  71.                                                                     SystemColor.menu.getGreen(),
  72.                                                                     SystemColor.menu.getBlue()));
  73.         System.out.println("menuText              " + colorToString(SystemColor.menuText.getRed(),
  74.                                                                     SystemColor.menuText.getGreen(),
  75.                                                                     SystemColor.menuText.getBlue()));
  76.         System.out.println("scrollbar             " + colorToString(SystemColor.scrollbar.getRed(),
  77.                                                                     SystemColor.scrollbar.getGreen(),
  78.                                                                     SystemColor.scrollbar.getBlue()));
  79.         System.out.println("text                  " + colorToString(SystemColor.text.getRed(),
  80.                                                                     SystemColor.text.getGreen(),
  81.                                                                     SystemColor.text.getBlue()));
  82.         System.out.println("textHighlight         " + colorToString(SystemColor.textHighlight.getRed(),
  83.                                                                     SystemColor.textHighlight.getGreen(),
  84.                                                                     SystemColor.textHighlight.getBlue()));
  85.         System.out.println("textHighlightText     " + colorToString(SystemColor.textHighlightText.getRed(),
  86.                                                                     SystemColor.textHighlightText.getGreen(),
  87.                                                                     SystemColor.textHighlightText.getBlue()));
  88.         System.out.println("textInactiveText      " + colorToString(SystemColor.textInactiveText.getRed(),
  89.                                                                     SystemColor.textInactiveText.getGreen(),
  90.                                                                     SystemColor.textInactiveText.getBlue()));
  91.         System.out.println("textText              " + colorToString(SystemColor.textText.getRed(),
  92.                                                                     SystemColor.textText.getGreen(),
  93.                                                                     SystemColor.textText.getBlue()));
  94.         System.out.println("window                " + colorToString(SystemColor.window.getRed(),
  95.                                                                     SystemColor.window.getGreen(),
  96.                                                                     SystemColor.window.getBlue()));
  97.         System.out.println("windowBorder          " + colorToString(SystemColor.windowBorder.getRed(),
  98.                                                                     SystemColor.windowBorder.getGreen() ,
  99.                                                                     SystemColor.windowBorder.getBlue()));
  100.         System.out.println("windowText            " + colorToString(SystemColor.windowText.getRed(),
  101.                                                                     SystemColor.windowText.getGreen(),
  102.                                                                     SystemColor.windowText.getBlue()));
  103.  
  104.         System.exit(0);
  105.     }
  106.  
  107.     /**
  108.      * @param red TODO
  109.      * @param green TODO
  110.      * @param blue TODO
  111.      * @since VCafe 3.0
  112.      */
  113.     
  114.     static String colorToString(int red, int green, int blue)
  115.     {
  116.         Color color;
  117.         
  118.         color = new Color(red, green, blue);
  119.         
  120.         if(color.equals(Color.white))
  121.         {
  122.             return ("White");
  123.         }        
  124.         else if(color.equals(Color.lightGray))
  125.         {
  126.             return ("Light Gray");
  127.         }
  128.         else if(color.equals(Color.gray))
  129.         {
  130.             return ("Gray");
  131.         }
  132.         else if(color.equals(Color.darkGray))
  133.         {
  134.             return ("Dark Gray");
  135.         }
  136.         else if(color.equals(Color.black))
  137.         {
  138.             return ("Black");
  139.         }
  140.         else if(color.equals(Color.red))
  141.         {
  142.             return ("Red");
  143.         }
  144.         else if(color.equals(Color.pink))
  145.         {
  146.             return ("Pink");
  147.         }
  148.         else if(color.equals(Color.orange))
  149.         {
  150.             return ("Orange");
  151.         }
  152.         else if(color.equals(Color.yellow))
  153.         {
  154.             return ("Yellow");
  155.         }
  156.         else if(color.equals(Color.green))
  157.         {
  158.             return ("Green");
  159.         }
  160.         else if(color.equals(Color.magenta))
  161.         {
  162.             return ("Magenta");
  163.         }
  164.         else if(color.equals(Color.cyan))
  165.         {
  166.             return ("Cyan");
  167.         }
  168.         else if(color.equals(Color.blue))
  169.         {
  170.             return ("Blue");
  171.         }
  172.         
  173.         return (red + ", " + green + ", " + blue);
  174.     }
  175. }